if __name__ == "__main__":
    group = {}
    elements = {}
    
    v1 = [1,3,5,7,9,11]
    v2 = [3,6,9,12,15,18]
    
    elements[1] = ['A', v1]
    elements[2] = ['A', v2]
    
    group['A'] = [1, 2]
    group['B'] = [2]
    
    #print elements
    #print group
    
    #print elements.keys()
    #print elements.values()
    
    #By Group
    for g in group.keys():
        elems = group[g]
        
        print g
        print "-------------"
        for e in elems:    
            for v in elements[e]:
                print v[1:]
                
        print
             
    